package com.cleaningcloud.cld.controller.mini;

import com.cleaningcloud.cld.api.domain.Vo.CldStaffDto;
import com.cleaningcloud.cld.domain.CldEvaluate;
import com.cleaningcloud.cld.domain.dto.CldWorkplanDto;
import com.cleaningcloud.cld.domain.vo.CldEvaluateVo;
import com.cleaningcloud.cld.service.ICldEvaluateService;
import com.cleaningcloud.cld.service.mini.IMiniEvaluateService;
import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.common.core.web.controller.BaseController;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import com.cleaningcloud.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * packageName com.cleaningcloud.cld.controller.mini
 *
 * @author Shaw
 * @version JDK 8
 * @className MiniEvaluateController
 * @date 2025-06-18
 * @description 客户评价
 */
@RestController
@RequestMapping("/mini/evaluate")
public class MiniEvaluateController extends BaseController {

    @Autowired
    IMiniEvaluateService miniEvaluateService;

    /**
     * @Author Shaw
     * @Description 客户评价
     * @date: 2025-06-18 9:39
     * @param: //TODO
     */
    @Operation(description = "客户评价")
    @PostMapping("/addEvaluate")
    public AjaxResult addEvaluate(@RequestBody CldEvaluate cldEvaluate) {
        return toAjax(miniEvaluateService.insertEvaluate(cldEvaluate));
    }

    /**
     * @Author Shaw
     * @Description 根据日期获取客户对员工评价列表
     * @date: 2025-06-20 15:51
     * @param: //TODO
     */
    @Operation(description = "获取客户对员工评价列表")
    @GetMapping("/getCldEvaluateListByDate")
    public TableDataInfo getCldEvaluateListByDate(CldEvaluateVo cldEvaluateVo) {
        List<CldEvaluateVo> list = miniEvaluateService.getCldEvaluateListByDate(cldEvaluateVo);
        return getMiniDataTable(list);
    }

    /**
     * @Author Shaw
     * @Description 根据日期获取客户对员工(综合)评价列表
     * @date: 2025-06-20 15:51
     * @param: //TODO
     */
    @Operation(description = "获取客户对员工(综合)评价列表")
    @GetMapping("/getCldEvaluateListByDateComprehensive")
    public TableDataInfo getCldEvaluateListByDateComprehensive(CldEvaluateVo cldEvaluateVo) {
        List<CldEvaluateVo> list = miniEvaluateService.getCldEvaluateListByDateComprehensive(cldEvaluateVo);
        return getMiniDataTable(list);
    }

    /**
     * @Author Shaw
     * @Description 根据日期获取客户对项目评价列表
     * @date: 2025-06-20 15:51
     * @param: //TODO
     */
    @Operation(description = "获取客户对员工评价列表")
    @GetMapping("/getCldEvaluateListProject")
    public TableDataInfo getCldEvaluateListProject(CldEvaluateVo cldEvaluateVo) {
        List<CldEvaluateVo> list = miniEvaluateService.getCldEvaluateListProject(cldEvaluateVo);
        return getMiniDataTable(list);
    }

    /**
     * @Author Shaw
     * @Description 根据评价ID获取详情（员工）
     * @date: 2025-06-18 9:39
     * @param: //TODO
     */
    @Operation(description = "查看员工评价详情")
    @GetMapping("/getCldEvaluateInfoById/{evaluateId}")
    public AjaxResult getCldEvaluateInfoById(@PathVariable Long evaluateId) {
        return success(miniEvaluateService.getCldEvaluateInfoById(evaluateId));
    }

    /**
     * @Author Shaw
     * @Description 根据评价ID获取详情（项目）
     * @date: 2025-06-18 9:39
     * @param: //TODO
     */
    @Operation(description = "查看项目评价详情")
    @GetMapping("/getCldEvaluateInfoByProject/{evaluateId}")
    public AjaxResult getCldEvaluateInfoByProject(@PathVariable Long evaluateId) {
        return success(miniEvaluateService.getCldEvaluateInfoByProject(evaluateId));
    }

}